package com.abel.parser.configuration;

import com.abel.parser.service.ParserFactory;
import org.springframework.beans.factory.config.ServiceLocatorFactoryBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * parser解析
 *
 * @author heyangyang
 * @since 2024-04-26
 */
@Configuration
public class ParserConfig {

    @Bean("parserFactory")
    public ServiceLocatorFactoryBean parserFactory() {
        ServiceLocatorFactoryBean factoryBean = new ServiceLocatorFactoryBean();
        // 设置服务定位接口
        factoryBean.setServiceLocatorInterface(ParserFactory.class);
        return factoryBean;
    }

}
